using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using Unity.VisualScripting;
// 组合输入源，处理玩家的所有输入
public class PlayerReaderSource : IInputSource
{
    private MoveInputReader moveInputReader;
    private MouseInputReader mouseInputReader;

    //接口类
    public bool MoveInput { get; private set; }
    public bool ShiftMoveInput { get; private set; }
    public bool IsJumping { get; private set; }

    public bool leftClick { get; private set; }
    public bool rightClick { get; private set; }
    public bool rightHoldClick { get; private set; }
    public bool die { get; private set; }
    public void StartMove() { }
    public void StopMove() { }
    // 构造函数，初始化输入处理器
    public PlayerReaderSource(MoveInputReader input, MouseInputReader mouse)
    {
        moveInputReader = input;
        mouseInputReader = mouse;
    }
    
    public void onUpdate()
    {
        //角色的状态
        if (moveInputReader != null)
        {
            ShiftMoveInput = moveInputReader.IsShiftMovePressed();
            IsJumping = moveInputReader.IsJumpPressed();
            MoveInput = moveInputReader.IsMovePressed();
        }

        if (mouseInputReader != null)
        {
            leftClick = mouseInputReader.IsLeftClickPressed();
        }
    }

}
